# -*- coding:utf-8 -*-
# @FileName  :per_statistics.py
# @Time      :2020/12/7 9:55
# @Author    :Zhoujirong
# @Desc      :
from common.http_request import Request
from biz.support.urls import ServerUrl

class EntStatisticsRequest:
    @classmethod
    def statistics_by_user(cls,day0,month0,
                year0,day1,
                month1,year1,
                search_EQ_userType,
                search_EQ_batchFlag,
                search_EQ_source,
                search_EQ_autharchiveId,
                search_EQ_status,
                search_EQ_formReport,
                search_EQ_queryType,
                search_EQ_queryFormat,
                search_GTE_updateTime_DATE,
                search_LTE_updateTime_DATE,cookie):
        data = {
                'day0':day0,
                'month0':month0,
                'year0':year0,
                'day1':day1,
                'month1':month1,
                'year1':year1,
                'search_EQ_userType':search_EQ_userType,
                'search_EQ_batchFlag':search_EQ_batchFlag,
                'search_EQ_source':search_EQ_source,
                'search_EQ_autharchiveId':search_EQ_autharchiveId,
                'search_EQ_status':search_EQ_status,
                'search_EQ_formReport':search_EQ_formReport,
                'search_EQ_queryType':search_EQ_queryType,
                'search_EQ_queryFormat':search_EQ_queryFormat,
                'search_GTE_updateTime_DATE':search_GTE_updateTime_DATE,
                'search_LTE_updateTime_DATE':search_LTE_updateTime_DATE
        }
        req = Request(ServerUrl.ent_statisticsbyuser_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def statistics_by_org(cls,day0,
            month0,year0,
            day1,month1,
            year1,search_EQ_operOrg,
            search_EQ_batchFlag,
            search_EQ_source,
            search_EQ_autharchiveId,
            search_EQ_status,
            search_EQ_formReport,
            search_EQ_queryFormat,
            search_GTE_updateTime_DATE,
            search_LTE_updateTime_DATE,cookie):
        data= {
                'day0':day0,
                'month0':month0,
                'year0':year0,
                'day1':day1,
                'month1':month1,
                'year1':year1,
                'search_EQ_operOrg':search_EQ_operOrg,
                'search_EQ_batchFlag':search_EQ_batchFlag,
                'search_EQ_source':search_EQ_source,
                'search_EQ_autharchiveId':search_EQ_autharchiveId,
                'search_EQ_status':search_EQ_status,
                'search_EQ_formReport':search_EQ_formReport,
                'search_EQ_queryFormat':search_EQ_queryFormat,
                'search_GTE_updateTime_DATE':search_GTE_updateTime_DATE,
                'search_LTE_updateTime_DATE':search_LTE_updateTime_DATE
        }
        req = Request(ServerUrl.ent_statisticsbyorg_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def statistics_by_rule(cls,search_GTE_startDate_DATE,
                                search_GTE_alertDate_DATE,
                                search_IN_deptCode,cookie):
        data = {
            'search_GTE_startDate_DATE':search_GTE_startDate_DATE,
            'search_GTE_alertDate_DATE':search_GTE_alertDate_DATE,
            'search_IN_deptCode':search_IN_deptCode
        }
        req = Request(ServerUrl.ent_statisticsbyrule_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def exportbyuser(cls, day0,
                     month0, year0,
                     day1, month1,
                     year1,
                     search_EQ_userType,
                     search_EQ_batchFlag,
                     search_EQ_source,
                     search_EQ_autharchiveId,
                     search_EQ_status,
                     search_EQ_formReport,
                     search_EQ_queryFormat,
                     search_GTE_updateTime_DATE,
                     search_LTE_updateTime_DATE, cookie):
        data = {
            'day0': day0,
            'month0': month0,
            'year0': year0,
            'day1': day1,
            'month1': month1,
            'year1': year1,
            'search_EQ_userType': search_EQ_userType,
            'search_EQ_batchFlag': search_EQ_batchFlag,
            'search_EQ_source': search_EQ_source,
            'search_EQ_autharchiveId': search_EQ_autharchiveId,
            'search_EQ_status': search_EQ_status,
            'search_EQ_formReport': search_EQ_formReport,
            'search_EQ_queryFormat': search_EQ_queryFormat,
            'search_GTE_updateTime_DATE': search_GTE_updateTime_DATE,
            'search_LTE_updateTime_DATE': search_LTE_updateTime_DATE
        }
        req = Request(ServerUrl.ent_statisticsbyuser_download_url, params=data, headers=cookie)
        return req.get_download()

    @classmethod
    def exportbyorg(cls,day0,
                     month0, year0,
                     day1, month1,
                     year1,
                     search_EQ_operOrg,
                     search_EQ_batchFlag,
                     search_EQ_source,
                     search_EQ_autharchiveId,
                     search_EQ_status,
                     search_EQ_formReport,
                     search_EQ_queryFormat,
                     search_GTE_updateTime_DATE,
                     search_LTE_updateTime_DATE,cookie):
        data= {
                'day0':day0,
                'month0':month0,
                'year0':year0,
                'month1':month1,
                'day1':day1,
                'year1':year1,
                'search_EQ_operOrg':search_EQ_operOrg,
                'search_EQ_batchFlag':search_EQ_batchFlag,
                'search_EQ_source':search_EQ_source,
                'search_EQ_autharchiveId':search_EQ_autharchiveId,
                'search_EQ_status':search_EQ_status,
                'search_EQ_formReport':search_EQ_formReport,
                'search_EQ_queryFormat':search_EQ_queryFormat,
                'search_GTE_updateTime_DATE':search_GTE_updateTime_DATE,
                'search_LTE_updateTime_DATE':search_LTE_updateTime_DATE
        }
        req = Request(ServerUrl.ent_statisticsbyorg_download_url,params=data,headers=cookie)
        return req.get_download()



if __name__ == "__main__":
    pass